<?php
class Zend_View_Helper_ShowMenuIndex {
    public function showMenuIndex($view) {

    	$menus = $view->Menu;
    	$str='';
       
        $str .= '<table width="960">';
	$str .= '<tr>';
 
        $str .= '<table id="product-table" border="0" cellpadding="0" cellspacing="0" width="100%">';
        $str .= '<tr>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Tên menu</a></th>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Mô tả</a></th>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Ngôn ngữ</a></th>';
        $str .= '<th class="table-header-options line-left minwidth-2"><a href="">Thao tác</a></th>';
        $str .= '</tr>';	
		
         $i=0;
        foreach ($menus as $menu) {
            if($i>=1)
                $i=0;
            else
                $i++;
            
            if($i==1)
                $str .= '<tr>';
            else 
                $str .= '<tr class="alternate-row">';
                
            $str .='<td>'.$menu->name.'</td>';
            $str .='<td>'.$menu->description.'</td>';
            $str .='<td>'.$menu->language.'</td>';
            $str .= '<td class="options-width">';
            $str .= '<a title="Sửa" class="icon-1 info-tooltip" href="'.$view->url(array('controller'=>'menu', 'action'=>'edit', 'menu_id'=>$menu->menu_id)).'"></a> ';
            $str .= '<a title="Thêm" class="icon-3 info-tooltip" href="'.$view->url(array('controller'=>'menu', 'action'=>'add','menu_id'=>$menu->menu_id)).'"></a>';
            //$str .= '<a title="Kích hoạt" class="icon-5 info-tooltip" href="'.$view->url(array('module'=>'default', 'controller'=>'page','action'=>'detail','menu_id'=>$menu->menu_id)).'"></a>';
            $str .= '<a title="Xóa" class="icon-2 info-tooltip" href="'.$view->url(array('controller'=>'menu', 'action'=>'delete','menu_id'=>$menu->menu_id)).'"></a></td>';
            $str .='</tr>';
        }
        $str .= '</table>';
        
        return $str; 


    }
}
       